package com.coco.group.service;

import com.coco.group.vo.GroupGoodsAndItemVo;
import com.coco.common.result.ResultData;
import com.coco.group.pojo.TbGroupBuyGoods;
import com.coco.group.vo.GroupGoodsSearchVo;

import java.util.List;

/**
 * @Package: com.coco.group.service
 * @Author: 张dy
 * @Date: Created in 2021/7/29 下午 8:00
 */
public interface GroupBuyGoodsService {
    void addGroupGoods(GroupGoodsAndItemVo groupGoodsAndItemVo);

    List<TbGroupBuyGoods> findAll();

    ResultData<TbGroupBuyGoods> search(GroupGoodsSearchVo groupGoodsSearchVo);

    GroupGoodsAndItemVo findOne(Long id);

    void updateStatus(Long id, String status);

    void deleteGroupGoods(Long id);

    /**
     * 查询单条spu信息
     * @param id
     * @return
     */
    TbGroupBuyGoods findGoodsById(Long id);

    /**
     * 修改spu的参与人数和限量剩余
     * @param gid
     */
    void updateJoinNumAndStock(Long gid);


    void updateGroupGoods(GroupGoodsAndItemVo goods);

    /**
     * 添加库存
     * @param gid
     * @param num
     */
    void addStock(Long gid, Integer num);

}
